/**
 * @param {string[]} tokens
 * @return {number}
 */
var evalRPN = function (tokens) {
    const stack = []
    tokens.forEach((item) => {
        let num = Number(item)
        if (num || num === 0) {
            stack.push(num)
        } else {
            let n2 = stack.pop()
            let n1 = stack.pop()
            switch (item) {
                case '+':
                    stack.push(n1 + n2)
                    break
                case '-':
                    stack.push(n1 - n2)
                    break
                case '*':
                    stack.push(n1 * n2)
                    break
                case '/':
                    stack.push(n1 / n2 | 0)
                    break
            }
        }
    })
    return stack[0]
};